﻿<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<!--#include file="page.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>列表管理</title>
<link href="images/style.css" type="text/css" rel="stylesheet" />
<script src="WdatePicker.js" language="javascript"></script>
<style type="text/css">
<!--
body{line-height:25px;font-family:sans-serif; }

-->
</style>
</head>
<body>
<table width="95%" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td height="67" bgcolor="#ffffff"><table width="400" height="108" border="1" cellpadding="0" cellspacing="0" bordercolor="cedced">
<tr bgcolor="e9f1fa">
<td width="20%" height="25" align="center">&nbsp;</td>
<td width="20%" height="25" align="center">访问量(IP)</td>
<td width="20%" height="25" align="center">总流量(PV)</td>
<td width="20%" height="25" align="center" bgcolor="e9f1fa">百度</td>
<td width="20%" height="25" align="center" bgcolor="e9f1fa">谷歌</td>
</tr>
<tr>
<td width="20%" height="25" align="center" class="Traffic_Stat_red" >今日</td>
<td width="20%" height="25" align="center" class="Traffic_Stat_red" >
<%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct ip from Traffic_Stat where datetime like '%"&date&"%'" 
rs.open exec,conn,1,1 
ip=0
do while not rs.eof
ip=ip+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (ip)
%>
</td>
<td width="20%" height="25" align="center" class="Traffic_Stat_red" >
<%	
set rs=server.createobject("adodb.recordset") 
exec="select * from Traffic_Stat where datetime like '%"&date&"%'" 
rs.open exec,conn,1,1 
pv=0
do while not rs.eof
pv=pv+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (pv)
%>
</td>
<td width="20%" height="25" align="center" class="Traffic_Stat_red" >
<%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct Referer from Traffic_Stat where datetime like '%"&date&"%' and Referer like '%http://www.baidu%'" 
rs.open exec,conn,1,1 
dim baidu
baidu=0
do while not rs.eof
baidu=baidu+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (baidu)
%>      </td>
<td width="20%" height="25" align="center" class="Traffic_Stat_red">
<%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct Referer from Traffic_Stat where datetime like '%"&date&"%' and Referer like '%http://www.google%'" 
rs.open exec,conn,1,1 
dim google
google=0
do while not rs.eof
google=google+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (google)
%></td>
</tr>
<tr bgcolor="e9f1fa">
<td width="20%" height="25" align="center" bgcolor="#e9f1fa" class="Traffic_Stat_blue" >昨日</td>
<td width="20%" height="25" align="center" bgcolor="#e9f1fa" class="Traffic_Stat_blue" >
  <%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct ip from Traffic_Stat where datetime like '%"& (year(date) &"-"& month(date) &"-"& day(date)-1 )&"%'" 
rs.open exec,conn,1,1 
ip=0
do while not rs.eof
ip=ip+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (ip)
%>
</td>
<td width="20%" height="25" align="center" bgcolor="#e9f1fa" class="Traffic_Stat_blue" >
  <%	
set rs=server.createobject("adodb.recordset") 
exec="select * from Traffic_Stat where datetime like '%"& (year(date) &"-"& month(date) &"-"& day(date)-1 )&"%'" 
rs.open exec,conn,1,1 
pv=0
do while not rs.eof
pv=pv+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (pv)
%>
</td>
<td width="20%" height="25" align="center" bgcolor="#e9f1fa" class="Traffic_Stat_blue" >
  
  <%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct Referer from Traffic_Stat where datetime like '%"& (year(date) &"-"& month(date) &"-"& day(date)-1 )&"%' and Referer like '%http://www.baidu%'" 
rs.open exec,conn,1,1 
baidu=0
do while not rs.eof
baidu=baidu+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (baidu)
%>      
  </td>
<td width="20%" height="25" align="center" bgcolor="#e9f1fa" class="Traffic_Stat_blue" >
  
  <%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct Referer from Traffic_Stat where datetime like '%"& (year(date) &"-"& month(date) &"-"& day(date)-1 )&"%' and Referer like '%http://www.google%'" 
rs.open exec,conn,1,1 
google=0
do while not rs.eof
google=google+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (google)
%>      
  </td>
</tr>
<tr>
<td width="20%" height="25" align="center" bgcolor="#FFFFFF" class="Traffic_Stat_black">总量</td>
<td width="20%" height="25" align="center" bgcolor="#FFFFFF" class="Traffic_Stat_black">
  <%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct ip from Traffic_Stat" 
rs.open exec,conn,1,1 
dim ip
ip=0
do while not rs.eof
ip=ip+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (ip)
%>
</td>
<td width="20%" height="25" align="center" bgcolor="#FFFFFF" class="Traffic_Stat_black">
  <%	
set rs=server.createobject("adodb.recordset") 
exec="select * from Traffic_Stat" 
rs.open exec,conn,1,1 
dim pv
pv=0
do while not rs.eof
pv=pv+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (pv)
%>
</td>
<td width="20%" height="25" align="center" bgcolor="#FFFFFF" class="Traffic_Stat_black">
  
  <%	
set rs=server.createobject("adodb.recordset") 
exec="select * from Traffic_Stat where Referer like '%http://www.baidu%'" 
rs.open exec,conn,1,1 
baidu=0
do while not rs.eof
baidu=baidu+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (baidu)
%>      
  </td>
<td width="20%" height="25" align="center" bgcolor="#FFFFFF" class="Traffic_Stat_black">
  
  <%	
set rs=server.createobject("adodb.recordset") 
exec="select * from Traffic_Stat where Referer like '%http://www.google%'" 
rs.open exec,conn,1,1 
google=0
do while not rs.eof
google=google+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (google)
%>      
  </td>
</tr>

</table>    </td>
</tr>
<tr>
  <td height="30" bgcolor="#ffffff"><p>
    <%
dim Time1,Time2,Time3,Time4,Time5,Time6,Time7,Time8,Time9,Time10,Time11,Time12,Time13,Num
Time1=0:Time2=0:Time3=0:Time4=0:Time5=0:Time6=0:Time7=0:Time8=0:Time9=0:Time10=0:Time11=0:Time12=0:Time13=0:Num=0
set rs=server.createobject("adodb.recordset") 
exec="select * from Traffic_Stat where datetime like '%"&date&"%' order by id desc" 
'response.write (exec)
'response.end
rs.open exec,conn,1,1
if rs.eof or rs.bof then
response.write "没有数据！"

end if 
do while not rs.eof
dim hours
hours = hour(rs("datetime"))
select case hours
case 0,1
Time1=Time1+1				
case 2,3
Time2=Time2+1								
case 4,5
Time3=Time3+1									
case 6,7
Time4=Time4+1									
case 8,9
Time5=Time5+1			
case 10,11
Time6=Time6+1									
case 12,13
Time7=Time7+1								
case 14,15
Time8=Time8+1								
case 16,17
Time9=Time9+1							
case 18,19
Time10=Time10+1									
case 20,21
Time11=Time11+1									
case 22,23
Time12=Time12+1					
end select			
'response.write (hours) & "<br>"
Num=Num+1
rs.movenext
loop
rs.close
set rs = nothing
'response.end
%>
  </p>
    <table border="1" cellpadding="0" cellspacing="0" bordercolor="cedced">
      <tr bgcolor="e9f1fa">
        <td height="25" style="padding-top:3px;"> <strong>　今日受访时段分析</strong></td>
      </tr>
      <tr>
        <td height="135" colspan="3" valign="top" bgcolor="#FFFFFF"><table height="200" border="0" cellpadding="0" cellspacing="0" >
            <tr>
              <td width="30" height="175" valign="bottom" background="images/pv_bg.jpg"></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time1/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time1/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time2/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time2/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time3/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time3/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time4/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time4/Num)*100)%>></td>
              <td width="60" align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time5/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time5/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time6/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time6/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time7/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time7/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time8/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time8/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time9/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time9/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time10/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time10/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time11/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time11/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time12/Num)*100,1)%>%<br>
                <img src="images/pv_bar.jpg" width="16" height=<%=int((time12/Num)*100)%>></td>
              </tr>
            <tr>
              <td width="30" height="30"></td>
              <td height="30" align="center" class="Traffic_Stat_form">0:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">2:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">4:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">6:00</td>
              <td width="60" height="30" align="center" class="Traffic_Stat_form">8:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">10:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">12:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">14:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">16:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">18:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">20:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">22:00</td>
              </tr>
        </table>          </td>
      </tr>
    </table>    </td>
</tr>
<tr>
  <td height="30" bgcolor="#ffffff">
  <table width="372" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="cedced">
    <tr bgcolor="e9f1fa">
      <td height="25" colspan="3"><strong>　今日来路域名</strong></td>
    </tr>
    <%	
set rs=server.createobject("adodb.recordset") 
exec="select top 5 count(Referer) as num,Referer from Traffic_Stat where datetime like '%"&date&"%' group by Referer order by count(Referer) desc,Referer" 
rs.open exec,conn,1,1 
if rs.eof then
response.Write "&nbsp;暂无数据！"
end if 
%>
    <%
do while not rs.eof
if rs("Referer")<>"" then
%>
    <tr>
      <td height="22"><div class="Traffic_Stat_link"><a href="<%=rs("Referer")%>" target="_blank"><%=rs("Referer")%></a></div></td>
      <td width="48" height="22" align="center"><%=rs("num")%></td>
    </tr>
    <%
end if
rs.movenext
loop
%>
    <%
rs.close 
set rs =nothing
%>
  </table>
    <table width="372" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="cedced" style="margin-left:10px;">
      <tr bgcolor="e9f1fa">
        <td height="25" colspan="3"><strong>　今日受访页面</strong></td>
      </tr>
      <%	
set rs=server.createobject("adodb.recordset") 
exec="select top 5 count(*) as num,page from Traffic_Stat where datetime like '%"&date&"%' group by page order by count(*) desc,page" 
rs.open exec,conn,1,1 
if rs.eof then
response.Write "&nbsp;暂无数据！"
end if 
%>
      <%
do while not rs.eof
if rs("page")<>"" then
%>
      <tr>
        <td height="22"><div class="Traffic_Stat_link"><a href="<%=rs("page")%>"target="_blank"><%=rs("page")%></a></div></td>
        <td width="48" height="22" align="center"><%=rs("num")%></td>
      </tr>
      <%
end if
rs.movenext
loop
%>
      <%
rs.close 
set rs =nothing
%>
    </table>
    <p></p></td>
</tr>
<tr>
<td height="30" bgcolor="#ffffff"><table width="372" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="cedced">
  <tr bgcolor="e9f1fa">
    <td height="25" colspan="3"><strong>　今日搜索引擎</strong></td>
  </tr>
  <tr>
    <td height="22"><div class="Traffic_Stat_link">百度</div></td>
    <td width="48" height="22" align="center">
      <%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct Referer from Traffic_Stat where datetime like '%"&date&"%' and Referer like '%http://www.baidu%'" 
rs.open exec,conn,1,1 
baidu=0
do while not rs.eof
baidu=baidu+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (baidu)
%>    </td>
  </tr>
  <tr>
    <td height="22"><div class="Traffic_Stat_link">谷歌</div></td>
    <td width="48" height="22" align="center"><%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct Referer from Traffic_Stat where datetime like '%"&date&"%' and Referer like '%http://www.google%'" 
rs.open exec,conn,1,1 
google=0
do while not rs.eof
google=google+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (google)
%></td>
  </tr>
  <tr>
    <td height="22"><div class="Traffic_Stat_link">雅虎</div></td>
    <td width="48" height="22" align="center"><%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct Referer from Traffic_Stat where datetime like '%"&date&"%' and Referer like '%http://www.yahoo%'" 
rs.open exec,conn,1,1 
baidu=0
do while not rs.eof
baidu=baidu+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (baidu)
%></td>
  </tr>
  <tr>
    <td height="22"><div class="Traffic_Stat_link">搜搜</div></td>
    <td width="48" height="22" align="center"><%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct Referer from Traffic_Stat where datetime like '%"&date&"%' and Referer like '%http://www.soso%'" 
rs.open exec,conn,1,1 
baidu=0
do while not rs.eof
baidu=baidu+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (baidu)
%></td>
  </tr>
  <tr>
    <td height="22"><div class="Traffic_Stat_link">有道</div></td>
    <td width="48" height="22" align="center"><%	
set rs=server.createobject("adodb.recordset") 
exec="select distinct Referer from Traffic_Stat where datetime like '%"&date&"%' and Referer like '%http://www.yodao%'" 
rs.open exec,conn,1,1 
baidu=0
do while not rs.eof
baidu=baidu+1
rs.movenext
loop
rs.close
set rs=nothing
response.write (baidu)
%></td>
  </tr>
</table>
<table width="372" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="cedced" style="margin-left:10px;">
  <tr bgcolor="e9f1fa">
    <td height="25" colspan="3"><strong>　今日来路地区分布</strong></td>
  </tr>
  <%	
set rs=server.createobject("adodb.recordset") 
exec="select top 5 count(Province) as num,Province from Traffic_Stat where datetime like '%"&date&"%' group by Province order by count(Province) desc,Province"
rs.open exec,conn,1,1 
if rs.eof then
response.Write "&nbsp;暂无数据！"
end if 
%>
  <%
do while not rs.eof
%>
  <tr>
    <td height="22"><div class="Traffic_Stat_link"><%=rs("Province")%> </div></td>
    <td width="48" height="22" align="center"><%=rs("num")%></td>
  </tr>
  <%
rs.movenext
loop
%>
  <%
rs.close 
set rs =nothing
%>
</table>  <p>&nbsp;</p>  </td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<% 
if Request.QueryString("xiugaipx")="ok" then
id=request("id") 
sql="select * from about where id="&id 
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
IF not isNumeric(request("px_id")) then
response.write("<script>alert(""排序ID必须为数字！""); history.go(-1);</script>")
response.end
end if
rs("px_id")=request.form("px_id") 
rs.update 
rs.close 
response.Write("<script language=""javascript"">alert(""修改排序成功！"");window.location.href='Manage_About.asp';</script>")
end if
%> 
<%
if request("act")="del" then
id=request("id")
if id="" then
Response.Write "<script language='javascript'>alert('参数错误!');document.location.href('Manage_About.asp');</script>"
Response.End()
end if
set rs=server.createobject("adodb.recordset")
rs.open "Select * from about where id="&Request("id"),conn,1,3
if rs.bof and rs.eof then
Response.Write "<script language='javascript'>alert('数据库中没有该记录！');document.location.href('Manage_About.asp');</script>"
Response.End()
else
rs.Delete
rs.Update
Response.Write "<script language='javascript'>alert('成功删除指定的信息！');document.location.href('Manage_About.asp');</script>"
end if
end if
%>
